package com.hualan.service.service.service.wsj;

import com.hualan.mapper.wsj.CptmMapper;
import com.hualan.pojo.CategoryCount;
import com.hualan.pojo.wsj.Cptm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CptmServiceImpl implements CptmService {
    @Autowired
    private CptmMapper cptmMapper;
    public List<Cptm> listAll() {
        return cptmMapper.listAll();
    }

    // 新增按分类统计题目数量的方法
    public List<CategoryCount> countByCategory() {
        return cptmMapper.countByCategory();
    }

//    根据分类查询题目
    public List<Cptm> listByCategory(Integer category) {
        return cptmMapper.listByCategory(category);
    }
}
